FROM php:7.4.33-cli-bullseye

SHELL ["/bin/bash", "-cex"]

RUN apt-get update; \
    apt-get install -y --no-install-recommends \
            bzip2 \
            libbz2-dev \
            gettext \
            zlib1g-dev \
            libzip-dev \
            libfreetype-dev \
            libjpeg62-turbo-dev \
            libpng-dev \
            wget \
            vim \
    ; \
    rm -rf /var/lib/apt/lists/*

COPY install-php-extensions /usr/local/bin/

# 安装自带的
RUN docker-php-source extract \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install \
        bz2 \
        bcmath \
        calendar \
        gettext \
        gd \
        shmop \
        sockets \
        sysvsem \
        mysqli \
        pcntl \
        pdo_mysql \
        zip \
    && docker-php-source delete

# 安装外部的
RUN chmod +x /usr/local/bin/install-php-extensions \
    && install-php-extensions \
        redis \
        mcrypt \
        msgpack \
        inotify \
        soap \
        ssh2 \
        mongodb

COPY defaults.vim /usr/share/vim/vim82/defaults.vim
